<!DOCTYPE html>
<html lang="zh">

<head>
    <meta charset="UTF-8">
    <title>商品后台管理</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
    <link rel="stylesheet" href="./css/bootstrap.css">
    <link rel="stylesheet" href="./css/course_category.css">
</head>

<body>
    <div id="app">
        <nav class="navbar">
            <div class="container">
                <!-- Brand and toggle get grouped for better mobile display -->
                <div class="navbar-header">
                    <a class="navbar-brand" href="#">
                        <img src="image/easy-pay.png">
                    </a>
                </div>
                <ul class="nav navbar-nav navbar-right" style="margin-top: 30px">
                    <li><a href="#"><span class="inner">首页</span></a></li>
                    <li>
                        <a href="#">
                            <span class="inner">商品管理</span></a>
                    </li>
                    <li>
                        <a href="#">
                            <span class="inner">购物车管理</span>
                        </a>
                    </li>

                    <li>
                        <a href="#">
                            <span class="inner">用户管理</span></a>
                    </li>
                </ul>

            </div><!-- /.container-fluid -->
        </nav>
        <div style="min-height: 400px">
            <div class="container">
                <div class="panel panel-default">
                    <div class="panel-heading">
                        <h4>商品管理-商品详情</h4>
                    </div>
                    <div class="panel-body">
                        <!-- 在此处添加并完善文档结构代码 -->
                        <table class="table table-bordered">
                            
                        </table>
                        <div style="text-align: center">
                            <button class="btn btn-primary">返回上一级</button>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- 在此处完善页脚 -->
        <footer>
            <div class="container">
                <p class="text-center">易购集团</p>
                <p class="text-center">Copyright 2019</p>
            </div>
        </footer>
    </div>

</body>

</html>

<script src="./js/axios.min.js"></script>
<script>
    axios.post('http://localhost:8090/h7/goods/getGoods',{id:1})
    .then(res=>{
        // console.log(res.data);
        const table=document.querySelector('.table-bordered')
        table.innerHTML=`
        <tr>
                                <td style="width: 25%" class="text-center">商品编号</td>
                                <td class="text-left" id="inputId">${res.data.goods.id}</td>
                            </tr>
                            <tr>
                                <td style="width: 25%" class="text-center">商品标题</td>
                                <td class="text-left" id="inputId">${res.data.goods.title}</td>
                            </tr>
                            <tr>
                                <td style="width: 25%" class="text-center">商品详情</td>
                                <td class="text-left" id="inputId">${res.data.goods.content}</td>
                            </tr>
                            <tr>
                                <td style="width: 25%" class="text-center">图片路径</td>
                                <td class="text-left" id="inputId">${res.data.goods.imagePath}</td>
                            </tr>
                            <tr>
                                <td style="width: 25%" class="text-center">商品价格</td>
                                <td class="text-left" id="inputId">${res.data.goods.price}</td>
                            </tr>
        `
    })
</script>